<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<!-- head 标签，接收文件 title 参数 -->

<head>
    <meta charset="UTF-8">
    <title>添加地址</title>
</head>
<body>

<div class="wrapper">



        <div class="container-fluid">
            <div class="iq-card">
                <div class="iq-card-header d-flex justify-content-between">
                    <div class="iq-header-title">
                        <h4 class="card-title">添加配送地址</h4>
                    </div>
                </div>
                <div class="iq-card-body">
                    <div class="topbtn">
                        <a th:href="@{/user/address}" class="btn btn-info">返回配送地址列表</a>
                    </div>

                    <form id="departmentForm" name="departmentForm" th:action="@{/user/address}" method="post">


                        <!--2、在 form 表单中增加一个 input 输入框（hidden）用来告诉springboot我们要发送什么请求（PUT、DELETE）-->
                        <input type="hidden" name="_method" value="PUT" th:if="${null!=userAddress.addressId}">
                        <!--                     在 form 标签内容增加以下代码，用于保存ID，供提交修改时告诉服务器要修改哪一条记录：-->
                        <input type="hidden" name="departmentId" th:value="${userAddress.addressId}" th:if="${null!=userAddress.addressId}">

                        <div class="inputbox" style="width: 100%; max-width: 1100px; margin: 0 auto;">

                            <ul class="row">
                                <li class="col-md-12">
                                    <div>
                                        <ul class="row">
                                            <li class=" col-md-12"><h5 class="mt-2">姓名</h5>
                                                <fieldset class="form-group">


                                                    <input type="text" class="form-control" name="userName" th:value="${userAddress.userName}">
                                                </fieldset>
                                            </li>
                                            <li class=" col-md-12"><h5 class="mt-2">性别</h5>
                                                <fieldset class="form-group">

                                                    <input type="text" class="form-control" name="userName" th:value="${userAddress.userGender}">
                                                </fieldset>
                                            </li>
                                            <li class=" col-md-12"><h5 class="mt-2">电话</h5>
                                                <fieldset class="form-group">

                                                    <input type="text" class="form-control" name="userTel" th:value="${userAddress.userTel}">
                                                </fieldset>
                                            </li>
                                            <li class=" col-md-12"><h5 class="mt-2">省</h5>
                                                <fieldset class="form-group">

                                                    <input type="text" class="form-control" name="userProvince" th:value="${userAddress.userProvince}">
                                                </fieldset>
                                            </li>
                                            <li class=" col-md-12"><h5 class="mt-2">市</h5>
                                                <fieldset class="form-group">

                                                    <input type="text" class="form-control" name="userCity" th:value="${userAddress.userCity}">
                                                </fieldset>
                                            </li>
                                            <li class=" col-md-12"><h5 class="mt-2">区</h5>
                                                <fieldset class="form-group">

                                                    <input type="text" class="form-control" name="userDistrict" th:value="${userAddress.userDistrict}">
                                                </fieldset>
                                            </li>
                                            <li class="col-md-12">
                                                <h5 class="mt-2">详细地址</h5>
                                                <fieldset class="form-group">
                                                    <textarea class="form-control" rows="5" name="addressDetial" th:text="${userAddress.userAddress}"></textarea>
                                                </fieldset>
                                            </li>
                                        </ul>
                                    </div>
                                </li>
                            </ul>
                        </div>

                        <div class="text-center">
                            <button class="btn btn-primary" type="submit">确认提交</button>
                        </div>
                    </form>
                </div>






<script>
    lay('#version').html('-v' + laydate.v);
    laydate.render({
        elem: '#date'
        , range: true
        , theme: '#2c9eae'
    });
</script>


</body>
</html>
